﻿using System.Windows;
using System.Windows.Media;

namespace Xioa_UI.DataOrigin;

public static class RoundedAttach
{
    /// <summary>
    /// 圆角
    /// </summary>
    public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached(
        "CornerRadius", typeof(CornerRadius), typeof(RoundedAttach), new PropertyMetadata(default(CornerRadius)));

    public static void SetCornerRadius(DependencyObject element, CornerRadius value)
        => element.SetValue(CornerRadiusProperty, value);

    public static CornerRadius GetCornerRadius(DependencyObject element)
        => (CornerRadius)element.GetValue(CornerRadiusProperty);






    /// <summary>
    /// 角
    /// </summary>
    public static readonly DependencyProperty RadiusProperty = DependencyProperty.RegisterAttached(
        "Radius", typeof(double), typeof(RoundedAttach), new PropertyMetadata(default(double)));

    public static void SetRadius(DependencyObject element, double value)
        => element.SetValue(RadiusProperty, value);

    public static double GetRadius(DependencyObject element)
        => (double)element.GetValue(RadiusProperty);
}